package com.lzwk.beans.ocpx;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

/**
 * @title: AdbStudentInfo
 * @Author Yeaser
 * @Date: 2022/3/10 19:29
 * @Version 1.0
 * Description: TODO
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdbStudentInfo {


    private int account_id;
    private int term_class_id;
    private int division_activity_id;
    private int activity_term_id;
    private String state;
    private int refund_status;
    private String remark;
    private Timestamp create_time;
    private Timestamp update_time;
    private int id;
    private Boolean op;


    private String gender;
    private String age;
    private String telephone;
    private String career;
    private String wechat_nickname;

    public AdbStudentInfo(AdbClassStudent left, WkFormAccountInfo right) {
        mergeAdbClassStudent(left);
        mergeWkFormAccountInfo(right);
    }

    private void mergeAdbClassStudent(AdbClassStudent left) {
        if(left != null){
            this.account_id=left.getAccount_id();
            this.term_class_id=left.getTerm_class_id();
            this.division_activity_id=left.getDivision_activity_id();
            this.activity_term_id=left.getActivity_term_id();
            this.state=left.getState();
            this.refund_status=left.getRefund_status();
            this.remark=left.getRemark();
            this.create_time=left.getCreate_time();
            this.update_time=left.getUpdate_time();
            this.id=left.getId();
            this.op=left.getOp();
        }
    }

    private void mergeWkFormAccountInfo(WkFormAccountInfo right) {
        if(right != null){
            this.gender=right.getGender();
            this.age=right.getAge();
            this.telephone=right.getTelephone();
            this.career=right.getCareer();
            this.wechat_nickname=right.getWechat_nickname();
        }else{
            this.gender="0";
            this.age="";
            this.telephone="";
            this.career="";
            this.wechat_nickname="";
        }
    }


}
